# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1FeedbackMessage do
  @moduledoc """
  A feedback message inside a feedback thread.

  ## Attributes

  *   `body` (*type:* `String.t`, *default:* `nil`) - String content of the feedback. Maximum of 10000 characters.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Create time.
  *   `image` (*type:* `String.t`, *default:* `nil`) - The image storing this feedback if the feedback is an image representing operator's comments.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the feedback message in a feedback thread. Format: 'project/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessage/{feedback_message_id}'
  *   `operatorFeedbackMetadata` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata.t`, *default:* `nil`) - 
  *   `requesterFeedbackMetadata` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :body => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :image => String.t() | nil,
          :name => String.t() | nil,
          :operatorFeedbackMetadata =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata.t()
            | nil,
          :requesterFeedbackMetadata =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata.t()
            | nil
        }

  field(:body)
  field(:createTime, as: DateTime)
  field(:image)
  field(:name)

  field(:operatorFeedbackMetadata,
    as:
      GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata
  )

  field(:requesterFeedbackMetadata,
    as:
      GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1FeedbackMessage do
  def decode(value, options) do
    GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1FeedbackMessage.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1FeedbackMessage do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
